package cn.com.cifi.mars.web.action.report;

import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;

@Api(tags = "报表API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/report")
public interface ISignPlanProgressController {

    @ApiOperation(value = "手动刷新签约计划进度底表", notes = "刷新t_sign_plan_progress表数据\n"+
            "v1 : 指定年月,全量刷新\n")
    @GetMapping(value = "refreshSignPlanProgress")
    R refreshSignPlanProgress(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "年月", required = true) @RequestParam String yearMonth);

    @ApiOperation(value = "查询签约计划进度表", notes = "查询签约计划进度表")
    @GetMapping(value = "signPlanProgress")
    R signPlanProgress(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "指定年月", required = true) @RequestParam(value = "yearMonth",required = true) String yearMonth,
            @ApiParam(value = "模糊搜索字段(区域名称、城市名称、项目名称)", required = false) @RequestParam(value = "name",required = false) String name,
            @ApiParam(value = "版本状态", required = false) @RequestParam(value = "versionStatus",required = false) String versionStatus,
            @ApiParam(value = "起始时间", required = false) @RequestParam(value = "startTime",required = false)String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime",required = false)String endTime);

    @ApiOperation(value = "分页查询签约计划进度表", notes = "分页查询签约计划进度表")
    @GetMapping(value = "signPlanProgressPage")
    R signPlanProgressPage(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "页码", required = true) @RequestParam(value = "current",required = true) String current,
            @ApiParam(value = "条数", required = true) @RequestParam(value = "pageSize",required = true) String pageSize,
            @ApiParam(value = "指定年月", required = true) @RequestParam(value = "yearMonth",required = true) String yearMonth,
            @ApiParam(value = "模糊搜索字段(区域名称、城市名称、项目名称)", required = false) @RequestParam(value = "name",required = false) String name,
            @ApiParam(value = "版本状态", required = false) @RequestParam(value = "versionStatus",required = false) String versionStatus,
            @ApiParam(value = "起始时间", required = false) @RequestParam(value = "startTime",required = false) String startTime,
            @ApiParam(value = "结束时间", required = false) @RequestParam(value = "endTime",required = false) String endTime);

    @ApiOperation(value = "签约计划进度表导出", notes = "签约计划进度表导出")
    @GetMapping(value = "signPlanProgressExport")
    void signPlanProgressExport(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            HttpServletResponse response,
            @ApiParam(value = "指定年月", required = true) @RequestParam String yearMonth);
}
